<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8"%>

<html>
<head>

<title></title>
<style type="text/css">
.sss {
	background-color: aqua;
}

body {
	text-align: center;
}

table {
	margin-left: 25%;
	margin-top: 5%;
}

td {
	width: 100px;
	height: 30px;
}

input {height =20px;line-hight =20px;
	width: 100%;
	height: 100%;
	outline: none;
	border: 0px
}
</style>
</head>
<script src="js/jquery.min.js"></script>
<script type="text/javascript">
		var a = document.getElementsByTagName("shuliang")


		$(function() {
			$("button").click(function() {
				var num = $("tr").length - 3;

				$("tr:last").after('<tr id=t' + (num + 1) +'>  <td><input type="" name="hangshu'+(num + 1)+'" style="text-align: center;" id="" value="' + (num + 1) + 
					 
						'" /> </td> <td><input type="" name="pinming'+(num + 1)+'" id="" value="" style="text-align: center;"/></td>  <td><input type="" name="danwei'+(num + 1)+'" id="" value=""  style="text-align: center;"/></td> <td><input type="" name="danjia'+(num + 1)+'" id="" value=""  style="text-align: center;"/></td>  <td><input type="" name="number'+(num + 1)+'" id="" value="" style="text-align: center;" /></td><td><input type="" name="money'+(num + 1)+'" id="" value=""  style="text-align: center;"/></td> <td><input type=button  id=t' +
					(num + 1) + '  value=是否删除 onclick = "delTr(' + (num + 1) + ' )" /></td>  </tr>');								

			});

		});



		function delTr(trid) {
			var flag = confirm("是否删除");

			if (flag) {
				$("#t" + trid).remove();
			}
		}
	</script>
<form action="BuyServlet?act=buy_list" method="post">
	<body>
		<table border="" cellspacing="" cellpadding="" id="ta">

			<tr>
				<td colspan="6" style="text-align: center;">购物清单</td>
				<td colspan="6" style="text-align: center;"><input
					type="submit" name="hang" id="" value="提交" /></td>

			</tr>

			<tr>
				<td>行数</td>
				<td>品名</td>
				<td>单位</td>
				<td>单价</td>
				<td>数量</td>
				<td>金额</td>
				<td><button type="button" id="ss">添加列表</button></td>


			</tr>
			<tr>




			</tr>
		
			</form>

		</table>
	</body>
</html>
